home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 March
/
Ahoy_Magazine_86-03_1986_Double_L.d64
/
rooting rout 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
294b
|
14 lines
10 rem problem #23-2 :
20 rem rooting routine
30 rem solution by thomson fung
40 rem
50 print"to exit, type a # < 1"
60 input"enter a # from 1 to 65535";d
70 if d<0 then end
80 x=100 : rem any initial value > 0
90 for i=1 to 10
100 x=.5*(x+d/x)
110 next i
120 print"square root of"d"="int(x+.5)
130 print : print : goto 50